package com.carltechnology.mahjonggamecaculation.views.impl;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.carltechnology.mahjonggamecaculation.R;
import com.carltechnology.mahjonggamecaculation.presenter.IMahjongDetailContentPresenter;
import com.carltechnology.mahjonggamecaculation.presenter.impl.MahjongDetailContentPresenter;
import com.carltechnology.mahjonggamecaculation.views.IMahjongDetailContentView;
import com.carltechnology.mahjonggamecaculation.views.IMahjongDetailView;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by WZTCM on 2016/6/29.
 */
public class MahjongDetailFragment extends android.support.v4.app.Fragment implements IMahjongDetailContentView{
    @InjectView(R.id.mahjongdetail_item_list)
    RecyclerView recyclerView;

    private IMahjongDetailContentPresenter presenter;
    private IMahjongDetailView mDetailView;




    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_mahjong_item_detail,container,false);
        ButterKnife.inject(this,rootView);
        assert recyclerView !=null;
        presenter=MahjongDetailContentPresenter.newInstance(this);
        return rootView;
    }

    @Override
    public void onResume() {
        super.onResume();
        presenter.showDetailInfo();
    }

    @Override
    public RecyclerView getRecycleView() {
        return recyclerView;
    }

    public IMahjongDetailView getmDetailView() {
        return mDetailView;
    }
    private void setMahjongDetailView(IMahjongDetailView mView){
        this.mDetailView = mView;
    }
    public static MahjongDetailFragment newInstance(IMahjongDetailView mDetailView){
        MahjongDetailFragment fragment = new MahjongDetailFragment();
        fragment.setMahjongDetailView(mDetailView);
        return fragment;
    }
}
